/*
 * ManipulationPanel.java
 *
 * Created on 12. Juni 2008, 14:54
 */

package twi.view.manipulation;

import java.awt.BorderLayout;

import javax.swing.JComponent;

import prefuse.data.Tree;
import prefuse.util.GraphLib;
import twi.result.graph.PrefuseGraphFactory;
import twi_project.TWI;

/**
 *
 * @author  Soeren
 */
public class ManipulationPanel extends javax.swing.JPanel {

    private TreeView treeView;
	/** Creates new form ManipulationPanel */
    public ManipulationPanel() {
        initComponents();
        
        Tree g = PrefuseGraphFactory.createGraph(TWI.getInstance().getOntologieModel());
        this.treeView = new TreeView(g, GraphLib.LABEL);
        this.jPanel_tree.setLayout(new BorderLayout());
        JComponent comp = treeView.demo(g, GraphLib.LABEL, new SelectionAdapter());
        this.jPanel_tree.add(comp, BorderLayout.CENTER);
        
        this.jPanel2.setLayout(new BorderLayout());
        this.jPanel2.add(new ManipulationMainPanel(), BorderLayout.CENTER);
        
        this.validate();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jSplitPane1 = new javax.swing.JSplitPane();
        jPanel_tree = new javax.swing.JPanel();
        jPanel2 = new javax.swing.JPanel();

        setName("Form"); // NOI18N

        jSplitPane1.setName("jSplitPane1"); // NOI18N

        jPanel_tree.setName("jPanel_tree"); // NOI18N

        javax.swing.GroupLayout jPanel_treeLayout = new javax.swing.GroupLayout(jPanel_tree);
        jPanel_tree.setLayout(jPanel_treeLayout);
        jPanel_treeLayout.setHorizontalGroup(
            jPanel_treeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 393, Short.MAX_VALUE)
        );
        jPanel_treeLayout.setVerticalGroup(
            jPanel_treeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 298, Short.MAX_VALUE)
        );

        jSplitPane1.setRightComponent(jPanel_tree);

        jPanel2.setName("jPanel2"); // NOI18N

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 298, Short.MAX_VALUE)
        );

        jSplitPane1.setLeftComponent(jPanel2);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
        );
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel_tree;
    private javax.swing.JSplitPane jSplitPane1;
    // End of variables declaration//GEN-END:variables

}
